import {Injectable} from '@angular/core';
import {HttpService} from '@kylin/http';
@Injectable()
export class DrawFeatureService {
    tabArr = [
        {
            title: '画点',
            index: 1,
            tabStatus: false
        },
        {
            title: '画线',
            index: 2,
            tabStatus: false
        },
        {
            title: '画面',
            index: 3,
            tabStatus: false
        },
        {
            title: '合并',
            index: 4,
            tabStatus: false
        },
        {
            title: '拆分',
            index: 5,
            tabStatus: false
        }
    ]
    returnTabArr() {
        return this.tabArr;
    }

    constructor(private http: HttpService) {}

    // 查询图层列表
    layersList (status, layerType) {
        return this.http.get('/layer/list', {status: status, layerType: layerType})
    }

    addNewLayers(layers) {
        return this.http.post('/layer', layers)
    }

    editLayer(layer) {
        return this.http.put('/layer', layer)
    }

    deteleLayers(id) {
        return this.http.delete('/layer/' + id)
    }

    getLayerDetail(id) {
        return this.http.get('/layer/' + id)
    }

}
